<?xml version="1.0"?>

<f:view xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">
	<h:head />
	<h:form id="portalMindmapBean">
		<h:body>
			<div class="portlet-msg-info">
				<h1>This portlet represents your Portal Organization(s) and
					User(s). It also list Role(s) associated with User(s)!</h1>
			</div>
			<div style="color: #6e9ebf; font-weight: bold">
				<span class="organization width"></span> This Color represents
				Organizations!
			</div>

			<div style="color: #82c542; font-weight: bold">
				<span class="user width"></span> This color represents Users!
			</div>

			<div style="color: #FFCC00; font-weight: bold">
				<span class="sub_organization width"></span> This Color represents
				Sub Organizations!
			</div>

			<div style="color: #cce24f; font-weight: bold">
				<span class="roles width"></span> This Color represents Roles!
			</div>

			<p:mindmap value="#{portalMindmapBean.root}"
				style="width:100%;height:600px;border:1px solid black; ">
				<p:ajax event="select" listener="#{portalMindmapBean.onNodeSelect}" />
				<p:ajax event="dblselect"
					listener="#{portalMindmapBean.onNodeDblselect}" update="myDialog"
					oncomplete="details.show()"  />
			</p:mindmap>

			<p:dialog widgetVar="details" header="Selected Node Details"
				resizable="false" modal="true" id="myDialog">
				<p:panelGrid columns="2">
					<h:outputLabel for="username" value="User Name : " rendered="#{portalMindmapBean.selectedUser}" />
					<p:outputLabel id="username" value="#{portalMindmapBean.userBean.userName}" rendered="#{portalMindmapBean.selectedUser}"/>
					
					<h:outputLabel for="email" value="Email Address : " rendered="#{portalMindmapBean.selectedUser}"/>
					<p:outputLabel id="email" value="#{portalMindmapBean.userBean.emailAddress}" rendered="#{portalMindmapBean.selectedUser}"/>
					
					<h:outputLabel for="screename" value="Screen Name : " rendered="#{portalMindmapBean.selectedUser}"/>
					<p:outputLabel id="screename" value="#{portalMindmapBean.userBean.screenName}" rendered="#{portalMindmapBean.selectedUser}"/>
				
					<h:outputLabel for="contactNo" value="Contact Number : " rendered="#{portalMindmapBean.selectedUser}"/>
					<p:outputLabel id="contactNo" value="#{portalMindmapBean.userBean.contactNo}" rendered="#{portalMindmapBean.selectedUser}"/>
					
					<h:outputLabel for="orgName" value="Organization Name : " rendered="#{portalMindmapBean.selectedOrganization}"/>
					<h:outputText  id="orgName" value="#{portalMindmapBean.organizationBean.organizationName}" rendered="#{portalMindmapBean.selectedOrganization}"  />
					
					<h:outputLabel for="orgType" value="Organization Type : " rendered="#{portalMindmapBean.selectedOrganization}"/>
					<h:outputText  id="orgType" value="#{portalMindmapBean.organizationBean.organizationType}" rendered="#{portalMindmapBean.selectedOrganization}"  />
				
				</p:panelGrid>
			</p:dialog>

		</h:body>
	</h:form>

	<style type="text/css">
		.width {
			display: inline-block;
			width: 15px;
			height: 15px;
		}
		
		.organization {
			background: #6e9ebf;
		}
		
		.user {
			background: #82c542;
		}
		
		.sub_organization {
			background: #FFCC00;
		}
		
		.roles {
			background: #cce24f;
		}
	</style>
</f:view>